package demo;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class DemoTest {
    public static void main(String[] args) {
        //初始化spring容器
        AnnotationConfigApplicationContext acac=new AnnotationConfigApplicationContext(Config.class);
        //获得spring容器中的保存对象
        //getBean(对象的名称/id，对象的类型.class)
    Stu stu = acac.getBean("stu",Stu.class);
        System.out.println(stu);
    }
}
